using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Data.Entity.ModelConfiguration.Configuration;
using ESoft.Core.DAO;
using ESoft.Core.Model;

namespace ESoft.Domain.Entity
{
    /// <summary>
    /// ShopOrder
    /// </summary>    
	[Table("shop_order")]
    public partial class ShopOrderEntity : BaseFakeModel<String>
    {		    
        /// <summary>
        /// 订单编号
        /// </summary>
		[Column("order_no")]
        public string OrderNo { get; set; }
    
        /// <summary>
        /// 订单名
        /// </summary>
		[Column("title")]
        public string Title { get; set; }
    
        /// <summary>
        /// 买方ID
        /// </summary>
		[Column("buyer_id")]
        public string BuyerId { get; set; }
    
        /// <summary>
        /// 店铺ID
        /// </summary>
		[Column("shop_id")]
        public string ShopId { get; set; }
    
        /// <summary>
        /// 商品总价
        /// </summary>
		[Column("product_amount_total")]
        public decimal? ProductAmountTotal { get; set; }
    
        /// <summary>
        /// 订单金额
        /// </summary>
		[Column("order_amount_total")]
        public decimal? OrderAmountTotal { get; set; }
    
        /// <summary>
        /// 运费金额
        /// </summary>
		[Column("logistics_fee")]
        public decimal? LogisticsFee { get; set; }
    
        /// <summary>
        /// 是否开箱验货
        /// </summary>
		[Column("is_unpacking_inspection")]
        public bool? IsUnpackingInspection { get; set; }
    
        /// <summary>
        /// 是否开发票
        /// </summary>
		[Column("is_invoice")]
        public bool? IsInvoice { get; set; }
    
        /// <summary>
        /// 发票编号 (订单发票表自动编号)
        /// </summary>
		[Column("order_invoice_id")]
        public string OrderInvoiceId { get; set; }
    
        /// <summary>
        /// 收货地址表自动编号
        /// </summary>
		[Column("address_id")]
        public string AddressId { get; set; }
    
        /// <summary>
        /// 订单物流编号
        /// </summary>
		[Column("orderlogistics_id")]
        public string OrderlogisticsId { get; set; }
    
        /// <summary>
        /// 1支付宝 2微信 3ApplePay 99线下支付
        /// </summary>
		[Column("pay_channel")]
        public int? PayChannel { get; set; }
    
        /// <summary>
        /// 第三方支付流水号
        /// </summary>
		[Column("out_trade_no")]
        public string OutTradeNo { get; set; }
    
        /// <summary>
        /// 付款时间
        /// </summary>
		[Column("pay_time")]
        public DateTime? PayTime { get; set; }
    
        /// <summary>
        /// 发货时间
        /// </summary>
		[Column("delivery_time")]
        public DateTime? DeliveryTime { get; set; }
    
        /// <summary>
        /// 结算状态，1未结算2结算中3已结算
        /// </summary>
		[Column("order_settlement_status")]
        public int? OrderSettlementStatus { get; set; }
    
        /// <summary>
        /// 结算时间
        /// </summary>
		[Column("order_settlement_time")]
        public DateTime? OrderSettlementTime { get; set; }
    
        /// <summary>
        /// 备注
        /// </summary>
		[Column("remark")]
        public string Remark { get; set; }
    
        /// <summary>
        /// 订单状态(1未付款,2已付款,3已发货,4已签收,5退货申请,6退货中,7已退货,8取消交易)
        /// </summary>
		[Column("state")]
        public int? State { get; set; }
    
        /// <summary>
        /// 创建时间
        /// </summary>
		[Column("create_time")]
        public DateTime? CreateTime { get; set; }
    }

	public class ShopOrderEntityRegstHelper : IEntityMapper
    {
        public void RegistTo(ConfigurationRegistrar configurations)
        {
            configurations.Add<ShopOrderEntity>(new EntityTypeConfiguration<ShopOrderEntity>());
        }
    }
}

